//
//  AmuseViewController.swift
//  DouYuZB
//
//  Created by 中创 on 2020/4/24.
//  Copyright © 2020 梁森. All rights reserved.
//

import UIKit


private let kAmuseMuneH:CGFloat = 200.0

class AmuseViewController: BaseAnchorViewController {

    // MARK:懒加载
    private lazy var amuseVM:AmuseViewModel = AmuseViewModel()
    fileprivate lazy var amuseMuneView:AmuseMuneView = {
        let amuseMuneView = AmuseMuneView()
        amuseMuneView.frame = CGRect(x: 0, y: -kAmuseMuneH, width: kScreenWidth, height: kAmuseMuneH)
        amuseMuneView.autoresizingMask = UIView.AutoresizingMask()
        amuseMuneView.backgroundColor = UIColor.white
        return amuseMuneView
    }()
    override func viewDidLoad() {
        super.viewDidLoad()
        print("AmuseViewController😄😄😄😄");
    }
}
extension AmuseViewController{
    override func setupUI() {
        super.setupUI()
        collectionView.contentInset = UIEdgeInsets(top: kAmuseMuneH, left: 0, bottom: 0, right: 0)
        collectionView.addSubview(amuseMuneView)
    }
}
extension AmuseViewController{
    override func getData() {
        baseVM = amuseVM
        amuseVM.requestAmuseData {
            self.collectionView.reloadData()
            var anchorGroups = self.amuseVM.anchorGroups
            anchorGroups.removeFirst()
            self.amuseMuneView.anchorGroups = anchorGroups
            
            self.requestDataFinish()
        }
    }
}
